from django.db import models

# Create your models here.
# class VipCourseData(models.Model):
#     stu_number = models.CharField(max_length=20, default=None, verbose_name='学习人数')
#     sum_number = models.CharField(max_length=20, default=None, verbose_name='累计人数')
#     course_score = models.CharField(max_length=20, default=None, verbose_name='课程评分')
#     price = models.CharField(max_length=40, default=0, verbose_name='课程价格')


class UserInfo(models.Model):
    name = models.CharField(max_length=20, verbose_name='用户名')
    pwd = models.CharField(max_length=18, verbose_name='密码')
    email = models.EmailField(max_length=40, verbose_name='邮箱')
    age = models.CharField(default=18,max_length=10, verbose_name='年龄')

    def __str__(self):
        return self.name

    class Meta:
        db_table = 'userinfo'
        verbose_name = '用户信息'


class Addr(models.Model):
    user = models.ForeignKey('UserInfo', verbose_name='所属用户', on_delete=models.CASCADE)
    mobile = models.CharField(max_length=18, verbose_name='手机号')
    city = models.CharField(max_length=10, verbose_name='城市')
    info = models.CharField(max_length=200, verbose_name='详细地址')

    def __str__(self):
        return self.info
